/*
*
*	节流函数
*
*/
const throttle = function(fn, delay){
	let runFlag = false;
	return function(e){
		if (runFlag) {
			return false;
		}
		runFlag = true;
		setTimeout(() =>{
			fn();
			runFlag = false;
		}, delay);
	}
}


/*
*  添加类名
*/
const addClassName = function(e,className){
	e.classList.add(className);
	// console.log("11");
}


/*
*  删除类名
*/
const delClassName = function(e,className){
	e.classList.remove(className);
	// console.log("11");
}


/*
*  添加事件
*/
const addEventListener = function(element, type, fn, bool=false){
	if (element.addEventListener) {
		element.addEventListener(type, fn, bool);
	} else if (element.attachEvent) {
		element.attachEvent('on'+type, fn);
	}else {
		element['on'+type]=fn;
	}
}

/*
*  删除事件
*/
const removeEventListener = function(element, type, fn, bool=false){
	if (element.removeEventListener) {
		element.removeEventListener(type, fn, bool);
	} else if (element.detachEvent) {
		element.attachEvent('on'+type, fn);
	}else {
		element['on'+type]=null;
	}	
}



/*
* 通过点击事件来 切换页面
*/


window.onload=function(){

const EA_play_select = document.getElementsByClassName('EAplay_select')[0];
const shop_select = document.getElementsByClassName('shop_select')[0];
const iframeEAplay = document.getElementsByClassName('iframeEAplay')[0];
const iframeShop = document.getElementsByClassName('iframeShop')[0];

addEventListener(EA_play_select,'click',()=>{
	iframeEAplay.style.display='block';
	iframeShop.style.display='none';
})

addEventListener(shop_select,'click',()=>{
	iframeShop.style.display='block';
	iframeEAplay.style.display='none';
})
	
}